hi,
I am sure that is a stupid error of mine, but why the hell
does this not work:
-------------------------------------------[color=blue]
>g++ test.cc[/color]
/tmp/ccUN1Hel.o: In function `main':
/tmp/ccUN1Hel.o(.tex t+0x26): undefined reference to `abs(int)'
collect2: ld returned 1 exit status
-------------------------------------------[color=blue]
> cat test.cc[/color]
#include <stdlib.h>
#include <stdio.h>
int main(){
int abs(int);
for (int jj=10;jj>=-10;jj--){
fprintf(stdout, "%d ===> %d\n",jj,abs(jj ));
}
return 0;
}
-------------------------------------------[color=blue]
>man 3 abs[/color]
ABS(3) Linux Programmer's
Manual ABS(3)
NAME
abs, labs, llabs, imaxabs - compute the absolute value of an
integer.
SYNOPSIS
#include <stdlib.h>
int abs(int j);
long int labs(long int j);
long long int llabs(long long int j);
-------------------------------------------
thanks, daniel
I am sure that is a stupid error of mine, but why the hell
does this not work:
-------------------------------------------[color=blue]
>g++ test.cc[/color]
/tmp/ccUN1Hel.o: In function `main':
/tmp/ccUN1Hel.o(.tex t+0x26): undefined reference to `abs(int)'
collect2: ld returned 1 exit status
-------------------------------------------[color=blue]
> cat test.cc[/color]
#include <stdlib.h>
#include <stdio.h>
int main(){
int abs(int);
for (int jj=10;jj>=-10;jj--){
fprintf(stdout, "%d ===> %d\n",jj,abs(jj ));
}
return 0;
}
-------------------------------------------[color=blue]
>man 3 abs[/color]
ABS(3) Linux Programmer's
Manual ABS(3)
NAME
abs, labs, llabs, imaxabs - compute the absolute value of an
integer.
SYNOPSIS
#include <stdlib.h>
int abs(int j);
long int labs(long int j);
long long int llabs(long long int j);
-------------------------------------------
thanks, daniel
Comment